<template>
  <div id="HomeSwiper">
    <swiper>
      <swiper-item v-for="(i, index) in banners" :key="index">
        <a :href="i.link">
          <img :src="i.image" alt="" @load="imageLoad"/>
        </a>
      </swiper-item>
    </swiper>
  </div>
</template>

<script>
import {Swiper,SwiperItem} from 'components/common/swiper/index.js'
export default {
  name: "HomeSwipper",
  data() {
    return {
      isLoad: false
    };
  },
  methods: {
    imageLoad(){
      if(!this.isLoad){
        this.$emit('swiperImageLoad');
      }
      this.isLoad =true;
    }
  },
  components: {
      Swiper,
      SwiperItem,
  },
  props: {
      banners: {
          type: Array,
          default(){
              return []
          }
      }
  }
};
</script>

<style scoped>
</style>